package com.example.weddingapp.utils;

import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.example.weddingapp.R;


/**
 * @author JianQiang Ding
 * @Date 2018-02-28.
 */

public class ImageLoaderUtil {

    public static void displayHeadImage(Context context, String path, ImageView imageView) {
        Glide.with(context)
                .load(path)
                .apply(new RequestOptions()
                        .circleCrop()
                        .placeholder(R.mipmap.icon_default))
                .into(imageView);
    }

    public static void displayNet(Context context, String url, ImageView imageView) {
        Glide.with(context)
                .load(url)
                .apply(new RequestOptions().error(R.mipmap.icon_default))
                .into(imageView);
    }


}
